const express = require('express');
const router = express.Router();
const db = require('../utils/db')


router.get('/orderGet',(req,res)=>{
    console.log(req.query);
    const sql = `select * from orderm;`;
    db.query(sql, (err, data) => {
        if (err) {
            res.send({ error: 1, msg: err })
        } else {
            console.log(data);
            if (data.length > 0) {
                res.send({ error: 0, data: data })

            } else {
                res.send({ error: 1, msg: err })
            }

        }
    })

})

module.exports = router;